import request from '@/utils/request'

export const getCityList = () => {
  return request({
    url: '/area/city?level=1',
    method: 'get'
  })
}

// 热门
export const getHotCity = () => {
  return request({
    url: '/area/hot',
    method: 'get'
  })
}

// 根据城市名称获取城市信息
export const getCityInfo = (name) => {
  return request({
    url: '/area/info',
    method: 'get',
    params: {
      name
    }
  })
}

// 获取子级城市列表
export const getSubCity = (id) => {
  return request({
    url: `/area?id=${id}`,
    method: 'get'
  })
}
